<template>
  <div>
    <h1>App</h1>
    <p>{{ count }}</p>
    <!-- 
      在vue2中，给组件绑定的是默认都是自定义事件
      要想绑定DOM事件，需要加上事件修饰符.native
     -->
    <Child @click.native="handleClick" />
  </div>
</template>

<script>
import Child from "./Child.vue";

export default {
  name: "App",
  components: {
    Child,
  },
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    handleClick() {
      this.count++;
    },
  },
};
</script>

<style></style>
